// baseModalMenu.ts
// import { IDomEditor, IButtonMenu } from '@wangeditor/editor'

class MySaveButtonMenu{
    // title: String,
    // tag: string,
    // $ele: HTMLDivElement;
    // $root: any;
    // ifInit = false;
    // iconSvg?: string | undefined;

    constructor () {
      this.title = '保存' // 自定义菜单标题，鼠标移入菜单展示的文字
      this.iconSvg = '<svg t="1709707408926" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5084" width="64" height="64"><path d="M563.93554 122.611368a48.609619 48.609619 0 0 0-47.970018 49.313179v30.636852a48.609619 48.609619 0 0 0 47.970018 49.313179c26.47945 0 47.970019-22.130169 47.970019-49.313179v-30.636852a48.609619 48.609619 0 0 0-47.970019-49.313179z" fill="#030000" p-id="5085"></path><path d="M991.700187 277.266708c0-2.046721-0.89544-3.837601-1.15128-5.820362a48.929419 48.929419 0 0 0-13.623485-40.998376l-215.737165-215.673204a49.377139 49.377139 0 0 0-36.073454-14.454966c-0.51168 0-0.89544-0.25584-1.34316-0.25584h-38.248095L685.331668 0l-0.44772 0.06396H339.116052L338.924172 0H81.612992l-0.70356 0.12792L80.269831 0a46.498938 46.498938 0 0 0-30.444972 12.024485c-0.9594 0.89544-2.302561 1.343161-3.198001 2.302561-1.08732 1.02336-1.599001 2.494441-2.494441 3.645721a45.859338 45.859338 0 0 0-11.832604 29.997252l0.12792 0.6396-0.12792 0.70356v924.734041l0.12792 0.831481-0.12792 0.57564c0 12.024485 4.924922 22.641849 12.344284 30.956652 0.70356 0.83148 1.15128 1.854841 1.854841 2.622361 1.2792 1.343161 2.942161 1.982761 4.349282 3.134041a47.074578 47.074578 0 0 0 29.421611 11.193005l0.575641-0.12792 0.57564 0.12792h861.157776l0.6396-0.12792 0.511681 0.12792a46.434978 46.434978 0 0 0 29.357651-11.256965c1.343161-1.15128 3.134041-1.790881 4.349282-3.134041 0.76752-0.76752 1.21524-1.790881 1.854841-2.622361a46.818738 46.818738 0 0 0 12.280324-30.956652l-0.12792-0.6396 0.12792-0.767521 0.12792-696.716552zM386.766271 95.940037h250.467458v193.223236H386.766271V95.940037z m352.483698 831.480325H284.813991v-250.851218l62.233105-62.233104h329.905808l62.297065 62.361024v250.723298z m156.510181 0h-60.570144v-267.097064c0-0.6396-0.3198-1.2792-0.38376-1.790881a48.865459 48.865459 0 0 0-14.391006-36.393254l-89.096314-88.904435a49.313179 49.313179 0 0 0-36.009494-14.454965c-0.57564 0-1.08732-0.3198-1.535041-0.3198H330.865209c-0.6396 0-1.21524 0.3198-1.85484 0.38376a49.249219 49.249219 0 0 0-36.457215 14.327045l-89.032354 88.968395a49.888819 49.888819 0 0 0-14.327046 36.585134c0 0.51168-0.3198 1.02336-0.3198 1.599001V927.420362H128.23985v-831.480325h162.586384v239.850094l0.12792 0.70356-0.12792 0.639601c0 11.640725 4.797002 21.938289 11.960524 30.253092 0.83148 1.08732 1.343161 2.430481 2.366521 3.389881 1.02336 1.02336 2.302561 1.471081 3.389882 2.366521a46.690818 46.690818 0 0 0 30.317051 11.960524l0.703561-0.12792 0.57564 0.12792h343.657214l0.76752-0.12792 0.703561 0.12792a46.371018 46.371018 0 0 0 30.317052-11.960524c1.15128-0.89544 2.366521-1.343161 3.389881-2.366521 1.08732-0.9594 1.471081-2.366521 2.366521-3.389881a46.626858 46.626858 0 0 0 12.024484-30.253092l-0.12792-0.639601 0.12792-0.70356V122.419488L895.76015 284.941911V927.420362z" fill="#030000" p-id="5086"></path></svg>'
      this.tag = 'button'
      this.alwaysEnable = true;
      this.$ele = document.createElement('div')
    }

    // 点击菜单时触发的函数
    // exec (editor: IDomEditor, value: string | boolean) {
      exec(editor){
      // @ts-ignore
      // editor.showVariable()
      console.log(editor)
      editor.emit('saveEditor')
    }

    // 获取菜单执行时的 value ，用不到则返回空 字符串或 false
    // getValue (editor: IDomEditor): string | boolean {
      getValue() {   
      return false
    }

    // 菜单是否需要激活（如选中加粗文本，“加粗”菜单会激活），用不到则返回 false
    // isActive (editor: IDomEditor): boolean { // TS 语法
    isActive() { 
      return false
    }

    // 菜单是否需要禁用（如选中 H1 ，“引用”菜单被禁用），用不到则返回 false
    // isDisabled (editor: IDomEditor): boolean {
      isDisabled() { 
      return false
    }
}



export default MySaveButtonMenu

